package com.zm.tools.util;

import com.alibaba.fastjson.JSONObject;
import com.zm.tools.util.core.ExcelUtil;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;

import static java.lang.System.out;

/**
 * @author zoum
 * @create 2018/12/12 11:12
 */
public class Main {




    public static void main(String[]args) throws Exception{


        BufferedReader reader = new BufferedReader(new FileReader(new File("C:\\Users\\Administrator\\Desktop\\工作\\会员付费\\重复扣费数据.txt")));

        String lineS = "";
        List<JSONObject> busData = new ArrayList<>();
        while ((lineS = reader.readLine()) != null){
            JSONObject data = new JSONObject();
            lineS = lineS.replace("\"", "");
            out.println(lineS);
            String []ary = lineS.split(",");
            data.put("bank", ary[0]);
            data.put("bankName", ary[1]);
            data.put("mobile", ary[2]);
            data.put("name", ary[3]);
            data.put("idCard", ary[4]);
            data.put("userId", ary[5]);
            data.put("bindTime", ary[6]);
            busData.add(data);
        }

        ExcelUtil.export(new String[]{"bank-银行卡号","bankName-开户行","mobile-手机号","name-姓名","idCard-身份证号","userId-用户ID", "bindTime-绑卡时间"}, busData, "C:\\Users\\Administrator\\Desktop\\工作\\会员付费\\重复扣费数据1.xls" );
    }
}
